public class BeASniffer{
    // fake all the var in the PMP system
    // data based on David's Email
    //counts: contains the individual detection events
   
    // make arrary of sniffer
    
    ArrayList<Sniffer> beaSniffers = new ArrayList<Sniffer>(); 
    ArrayList<Node> beaNodes = new ArrayList<Node>();
    
    int beaTotalSniffers;
    int beaTotalNodes;
    
    Timer timer;
    
    /**
     *  Make sniffers and nodes
     * 
     */
    
    BeASniffer(int totalSniffers, int totalNodes){
    
    for (int i=0; i < abs(totalSniffers); i++) {
      Sniffer each = new Sniffer( i,
                                  day(),
                                  String.valueOf(i), 
                                  "device_type", 
                                  "mac_address"
                                  );
      this.beaSniffers.add(each);     // geo locations
    }
    
    for (int i=0; i< abs(totalNodes); i++){
      Node each = new Node( i,
                            day(),
                            String.valueOf(int(random(totalSniffers))), // put in randome sniffer
                            "wifi",  // don't care
                            "AA:BB:CC"
                            );
      this.beaNodes.add(each);
      
      this.timer = new Timer(500);
      this.timer.start();
      
    }  
  }
  
  ArrayList<Sniffer> getSniffers(){
    return this.beaSniffers;
  }
  ArrayList<Node> getNodes(){
    return this.beaNodes;
  }
  
  // my while 1 loop
  // no draw on screen
  void draw(){
    int moved;
    // Change Hostname for random node
    if (timer.isFinished()) {
      moved = int(random(this.beaSniffers.size()));
      Node node;
      node = this.beaNodes.get(int(random(this.beaNodes.size())));
      node.setHost(this.beaSniffers.get(moved));
      timer.start();
    }
  }
}


